package com.cskaoyan.javase.oop1._1basic;
/**
 * 测试类
 * @since 15:52
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Test {
    public static void main(String[] args) {
        // 使用new关键字就一定会在堆上创建一个独立的新对象
        Teacher t1 = new Teacher();
        Teacher t2 = new Teacher();

        System.out.println(t1 == t2);
        Teacher t3 = t1;
        System.out.println(t1 == t3);
        /*
            打印对象名
            和打印数组名效果类似
            得到了一个字符串:
            com.cskaoyan.javase.oop1._1basic.Teacher@1540e19d
            全限定类名 + "@" + 十六进制地址值
            (打印引用,默认情况下是打印地址值)
         */
        System.out.println(t1);
        System.out.println(t2);
        System.out.println(t3);
    }
}
